﻿@*
    TicketDesk - Attribution notice
    Contributor(s):

         Stephen Redd (stephen@reddnet.net, http://www.reddnet.net)

    This file is distributed under the terms of the Microsoft Public
    License (Ms-PL). See http://opensource.org/licenses/MS-PL
    for the complete terms of use.

    For any distribution that contains code from this file, this notice of
    attribution must remain intact, and a copy of the license must be
    provided to the recipient.
*@

@using TicketDesk.Domain
@using TicketDesk.Domain.Model
@model  Ticket
@{
    var activity = (TicketActivity)ViewBag.Activity;
    var ajaxOptions = new AjaxOptions { UpdateTargetId = "activityPanel", OnBegin = "editTicket.beginActivity", OnSuccess = "editTicket.completeActivity", OnFailure = "editTicket.failActivity" };
}
@using (Ajax.BeginForm(activity.ToString(), "TicketActivity", new { ticketId = Model.TicketId }, ajaxOptions, new { @class = "form-horizontal" }))
{
    @Html.AntiForgeryToken()
    <input type="hidden" id="tempId" value="@ViewBag.TempId" />
    <div id="activityBody">
        
        @Html.Partial(string.Format("_{0}", activity), Model)
        @Html.Partial("_ActivityComment", new TicketEvent() { IsHtml = ViewBag.IsEditorDefaultHtml })
    </div>
    <div class="panel-footer">
        <div>
            <button type="submit" class="btn btn-success" tabindex="25">@activity.GetDescription()</button>&nbsp;&nbsp;<a href="#" onclick="return editTicket.cancelActivity(event);">Cancel</a>
        </div>
    </div>
}

